.App {
  text-align: center;
}

.ant-table-cell {
  padding: 8px 12px !important;
  border-right: 1px solid #e8e8e8 !important; /* 使用更细的边框 */
  box-sizing: border-box !important; /* 确保边框不影响尺寸 */
}

/* 表格头部单元格的边框 */
.ant-table-thead > tr > th {
  border-right: 1px solid #e8e8e8 !important;
  background-color: #fafafa !important;
  box-sizing: border-box !important;
}

/* 表格体单元格的边框 */
.ant-table-tbody > tr > td {
  border-right: 1px solid #e8e8e8 !important;
  box-sizing: border-box !important;
}

/* 最后一列不需要右边框 */
.ant-table-cell:last-child {
  border-right: none !important;
}

.editable-cell {
  position: relative;
}

.editable-cell-input-wrapper {
  padding: 5px 11px;
}

.editable-cell-text-wrapper {
  padding: 5px 11px;
}

.editable-cell-icon {
  position: absolute;
  right: 0;
  width: 20px;
  cursor: pointer;
}

.editable-cell-icon:hover {
  color: #108ee9;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
}

table th,
table td {
  border: 1px solid #ddd;
  padding: 4px 8px;
  text-align: left;
}

table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

table.markdown-table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
}

table.markdown-table th,
table.markdown-table td {
  border: 1px solid #ddd;
  padding: 4px 8px;
  text-align: left;
}

table.markdown-table th {
  background-color: #f5f5f5;
  font-weight: bold;
}

.highlighted-cell {
  position: relative;
}

.cell-annotation-indicator {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid #1890ff;
  border-bottom: 6px solid #1890ff;
}

/* 优化：选中单元格的样式 - 使用box-shadow避免尺寸变化 */
.selected-cell {
  background-color: #e6f7ff !important;
  box-shadow: inset 0 0 0 2px #1890ff !important; /* 使用内阴影代替边框 */
  position: relative !important;
}

.selected-cell:hover {
  background-color: #bae7ff !important;
}

/* 单元格容器的基础样式 */
.cell-container {
  transition: background-color 0.2s ease !important; /* 只对背景色做过渡 */
  box-sizing: border-box !important;
  position: relative !important; /* 确保图标定位正确 */
}

.cell-container:hover {
  background-color: #f5f5f5;
}

/* 单元格内容区域样式 */
.cell-content {
  position: relative;
  width: 100%;
  height: 100%;
}

/* 单元格图标悬停效果 */
.cell-container:hover .anticon-expand-alt {
  opacity: 1 !important;
  color: #1890ff !important;
}

.version-compare-diff {
  padding: 2px 4px;
  border-radius: 2px;
}

.diff-added {
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
}

.diff-deleted {
  background-color: #fff2f0;
  border: 1px solid #ffccc7;
  text-decoration: line-through;
}

.diff-modified {
  background-color: #fffbe6;
  border: 1px solid #ffe58f;
}

@media (max-width: 768px) {
  .ant-table-wrapper {
    overflow-x: auto;
  }
  
  .ant-card {
    margin-bottom: 16px;
  }
}